package com.cloud.cmt.usermanage.dao.repository;

import com.cloud.cmt.usermanage.dao.EnterpriseReferrerDAO;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * 浙江卓锐科技股份有限公司 版权所有 © Copyright 2017<br>
 * 说明: <br>
 * 项目名称: cloud-maintenance <br>
 * 创建日期: 2017年10月18日 16:47 <br>
 * 作者: <a href="6492178@gmail.com">汪萌萌</a>
 */
@Repository
public interface EnterpriseReferrerRepository extends PagingAndSortingRepository<EnterpriseReferrerDAO, Long> {
    @Query(value = "select e.phone from enterprise_referrer r,employee e where r.referrer = e.employee_num and r.enterprise_id= :enterpriseId", nativeQuery = true)
    String getEmployeeByEnterpriseId(@Param("enterpriseId")long enterpriseId);
}
